import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:package_info/package_info.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBMineModule/YBAboutUsPage/YBAboutUsSubPage.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBUtils/YBBaseUtils/YBCallPhoneUtils.dart';


class YBAboutUsMianPage extends StatefulWidget {
  @override
  _YBAboutUsMianPageState createState() => _YBAboutUsMianPageState();
}

class _YBAboutUsMianPageState extends State<YBAboutUsMianPage> {


  String versionInfo;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _getPackInfo();
  }

  _getPackInfo() async{
    final PackageInfo info = await PackageInfo.fromPlatform();
    setState(() {
      versionInfo = info.version;
    });
  }


  @override
  Widget build(BuildContext context) {
    return Container(
      child: Scaffold(
        appBar: AppBar(
          title: Text(YBChineseText.mineUsAboutTitle,style: YBTextStyle.TextStyle30313320Medium,),
          elevation: 0,
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              Container(
                child: Column(
                  children: [
                    Container(
                      height:YBTextStyle.adapterSize50,
                    ),
                    Container(
                      child: Image.asset(YBImageStyle.getImagePath('quanjutubiao'),width: YBTextStyle.adapterSize72,height: YBTextStyle.adapterSize72,),
                    ),
                    Container(
                      height: YBTextStyle.adapterSize15,
                    ),
                    Container(
                      child: Text(
                        YBChineseText.workTaiNameTitle,
                        style: YBTextStyle.TextStyle383A3D15Medium,
                      ),
                    ),
                    Container(
                      height: YBTextStyle.adapterSize10,
                    ),
                    Container(
                      child: Text(
                        versionInfo??"1.0.0",
                        style: YBTextStyle.TextStyle969AA314light,
                      ),
                    ),
                  ],
                ),
              ),
              Container(
                height: YBTextStyle.adapterSize30,
              ),
              // Container(
              //   child: InkWell(
              //     child: YBAboutUsSubPage(title: "去评价",),
              //     onTap: (){
              //
              //     },
              //   ),
              // ),
              // Container(
              //   child: InkWell(
              //     child: YBAboutUsSubPage(title: "版本更新",),
              //     onTap: (){
              //
              //     },
              //   ),
              // ),
              // Container(
              //   height: 10,
              // ),
              Container(
                child: InkWell(
                  child: YBAboutUsSubPage(title: YBChineseText.mineYiSiZhengCeTitle,),
                  onTap: (){
                    YBApplication.router.navigateTo(context, '/mine/mineYinSiZhengCePage');
                  },
                ),
              ),
              Container(
                child: InkWell(
                  child: YBAboutUsSubPage(title: YBChineseText.mineFaLvShengMingTitle,),
                  onTap: (){
                    YBApplication.router.navigateTo(context, '/mine/mineFaLvShengMingPage');
                  },
                ),
              ),
              Container(
                child: InkWell(
                  child: YBAboutUsSubPage(title: YBChineseText.mineFuWuTiaoKuanTitle,),
                  onTap: (){
                    YBApplication.router.navigateTo(context, '/mine/mineFuWuTiaoKuanPage');
                  },
                ),
              ),
              Container(
                height: YBTextStyle.adapterSize10,
              ),
              Container(
                height: YBTextStyle.adapterSize58,
                color: YBColor.white,
                child: InkWell(
                  child: Padding(
                    padding: EdgeInsets.only(left: YBTextStyle.adapterSize20,right: YBTextStyle.adapterSize20),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          child: Text(
                            YBChineseText.mineMyDeKeFuTitle??"",
                            style: YBTextStyle.TextStyle1C1D1F15,
                          ),
                        ),
                        Expanded(
                          child: Container(
                            alignment: Alignment.centerRight,
                            child: Text(
                              "4008-260-189",
                              style: YBTextStyle.TextStyle90939915,
                            ),
                          ),
                        ),
                        Container(
                          width: YBTextStyle.adapterSize10,
                        ),
                        Container(
                          child: Image.asset(YBImageStyle.getImagePath("findIconArrowRight")),
                        ),
                      ],
                    ),
                  ),
                  onTap: (){
                    YBCallPhoneUtils().getCallPhoneUtils("tel:4008260189");
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

